﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Entities;
using FluentNHibernate.Mapping;

namespace Database.Mappings
{
    public class TopicMapping:ClassMap<Topic>
    {
        public TopicMapping()
        {
            Id(x => x.Id);
            Map(x => x.TopicName);
            HasMany(x => x.Chapters).Cascade.Delete().OrderBy("NumberInOrder"); ;
            References(x => x.Course);
            Map(x => x.NumberInOrder);
        }
    }
}
